from django.contrib.auth.models import User
from django.db import models
from utils.modelsMixin import ModelsSetMixin
# Create your models here.
class Classes(ModelsSetMixin):
    name=models.CharField(max_length=20,verbose_name='班级名称',help_text='班级名称')
    num=models.CharField('班级',max_length=20,help_text='班级')

    member=models.ManyToManyField(User)  #member多个成员 关联字段，某个来首或者学生可能在不同的班里，某个班级有多个老师或学生

    class Meta:
        db_table = 'classes'
        verbose_name = '班级'
        verbose_name_plural = verbose_name

    def __str__(self):
        return f'{self.name}-{self.num}'